/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util.article;

import java.io.Serializable;
import java.util.ArrayList;

/**
 *
 * @author Joris
 */
public class GroupDetails implements Serializable {
    
    private Integer id;
    private String name;
    private String description;
    private Integer parentGroup;
    private ArrayList<GroupDetails> childrenGroups;

    

    public GroupDetails() {
    }

    public GroupDetails(Integer id, String name, String description, Integer parentGroup) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.parentGroup = parentGroup;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getParentGroup() {
        return parentGroup;
    }

    public void setParentGroup(Integer parentGroup) {
        this.parentGroup = parentGroup;
    }
    
    public ArrayList<GroupDetails> getChildrenGroups() {
        return childrenGroups;
    }

    public void setChildrenGroups(ArrayList<GroupDetails> childrenGroups) {
        this.childrenGroups = childrenGroups;
    }
    
    public void addChildrenGroup (GroupDetails gd){
        if(childrenGroups == null)
            childrenGroups = new ArrayList<GroupDetails>();
        childrenGroups.add(gd);
    }
    
    @Override
    public String toString() {
        return this.name;
    }
    
}
